<?php
namespace App\Modules\Favorite;

use App\Modules\AdapterApi;
use App\Services\Favorite\FavoriteIndex;

/**
 * 收藏分类应用层
 * Class FavoriteCategory
 * @package App\Modules\Favorite
 */
class FavoriteCategory extends AdapterApi
{
    /*添加一个收藏分类*/
    public function addCate(): array
    {
        $data = pick_array($this->postData, ['pid','name','profile_pic','order','description','app_id','other_app_read','is_public','action']);
        return FavoriteIndex::FavoriteCategory()->addCate($data);
    }

    /*编辑一个收藏分类*/
    public function editCate(): array
    {
        $data = pick_array($this->postData, ['id', 'name', 'profile_pic', 'order', 'description', 'other_app_read', 'is_public', 'action']);
        return FavoriteIndex::FavoriteCategory()->editCate($data);
    }

//    /*查看该分类详情*/
//    public function oneCateInfo(): array
//    {
//        $data = $this->receiveData(['id'=>0, 'token'=>' ']);
//        return $this->stepRun($data, 'serverfavorite/favorite/FavoriteCategory/oneCateInfo', 'oneCateInfo', 'oneCateInfo');
//    }
//
//    /*查看收藏列表*/
//    public function cateList(): array
//    {
//        $data = $this->haveIssetReceiveData(['id'=>0, 'token'=>' ']);
//        return $this->stepRun($data, 'serverfavorite/favorite/FavoriteCategory/cateList', 'cateList', 'cateList');
//    }
//
//    /*查看指定应用下的收藏分类树*/
//    public function appCateList(): array
//    {
//        $data = $this->haveIssetReceiveData(['id'=>0, 'app_id'=>0]);
//        return $this->oneStepRun($data, 'serverfavorite/favorite/FavoriteCategory/cateList', 'cateList');
//    }
//
//    /*删除某个收藏分类*/
//    public function delOneCate(): array
//    {
//        $data = $this->receiveData(['id'=>0, 'token'=>' ']);
//        return $this->stepRun($data, 'serverfavorite/favorite/FavoriteCategory/delOneCate', 'delOneCate', 'delOneCate');
//    }
//
//    /*批量删除收藏分类*/
//    public function batchDelCate(): array
//    {
//        $data = $this->receiveData(['id'=>[], 'token'=>' ']);
//        return $this->stepRun($data, 'serverfavorite/favorite/FavoriteCategory/batchDelCate', 'batchDelCate', 'batchDelCate');
//    }
//
//    /*启用/禁用 一个 分类*/
//    public function changeStatus(): array
//    {
//        $data = $this->receiveData(['id'=>0,'status'=>' ', 'token'=>' ']);
//        return $this->stepRun($data, 'serverfavorite/favorite/FavoriteCategory/changeStatus', 'changeStatus', 'changeStatus');
//    }
//
//    /*启用/禁用 多个 分类*/
//    public function batchChangeStatus(): array
//    {
//        $data = $this->receiveData(['id'=>[],'status'=>' ', 'token'=>' ']);
//        return $this->stepRun($data, 'serverfavorite/favorite/FavoriteCategory/batchChangeStatus', 'batchChangeStatus', 'batchChangeStatus');
//    }

}